package com.xizi.chatBot.model;

import lombok.Data;
import org.springframework.util.StringUtils;

@Data
public class ChatInfo {
    private String chatId;
    private String title;

    public ChatInfo (String chatId,String title){
        if (StringUtils.hasLength(title)){
            if(title.length() < 10){
                this.title = title;
            }else{
                this.title = title.substring(0, 10) + "...";
            }
        }else {
            this.title = "无标题";
        }
        this.chatId = chatId;
    }
}
